package com.example.waibao.service.impl;

import com.example.waibao.dao.taskMapper;
import com.example.waibao.entity.box;
import com.example.waibao.entity.faq;
import com.example.waibao.entity.task;
import com.example.waibao.entity.task_review;
import com.example.waibao.mapper.taskMapper2;
import com.example.waibao.service.taskService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class taskServiceImpl implements taskService {

    @Autowired
    private taskMapper taskMapper;

    @Autowired
    private taskMapper2 taskMapper2;

    @Override
    public List<task_review> get_task_review(int schoolId, int status) {
        return taskMapper2.get_task_review(schoolId, status);
    }

    @Override
    public void solve_task_review(task_review taskReview) {
        taskMapper.solve_task_review(taskReview);
    }

    @Override
    public void add_score_detail(Date utilDate, int score, int taskId, int userId) {
        taskMapper.add_score_detail(utilDate, score, taskId, userId);
    }

    @Override
    public void update_score_sum(int userId, int score, Date utilDate) {
        taskMapper.update_score_sum(userId, score, utilDate);
    }

    @Override
    public void update_speciality_score(int score, int userId, Date utilDate) {
        taskMapper.update_speciality_score(score, userId, utilDate);
    }

    @Override
    public void update_student_level(int userId) {
        taskMapper.update_student_level(userId);
    }

    @Override
    public void set_blind_box(box box) {
        taskMapper.set_blind_box(box);
    }

    @Override
    public PageInfo<box> get_blind_box(int schoolId, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<box> f = taskMapper.get_blind_box(schoolId);
        PageInfo<box> dataPageInfo = new PageInfo<>(f);
        return dataPageInfo;
    }

    @Override
    public void delete_blind_box(int id) {
        taskMapper.delete_blind_box(id);
    }

    @Override
    public List<String> get_box(int schoolId) {
        return taskMapper.get_box(schoolId);
    }

    @Override
    public void update_head_heaver(int i) {
        taskMapper.update_head_heaver(i);
    }

    @Override
    public List<task> get_student_process1(int userId) {
        return taskMapper.get_student_process1(userId);
    }

    @Override
    public List<task> get_student_process2(int userId,int schoolId) {
        return taskMapper.get_student_process2(userId,schoolId);
    }
}
